#ifndef UPLOADLAYOUT_H
#define UPLOADLAYOUT_H

#include <QVBoxLayout>



class UploadLayout
{
public:
    static UploadLayout* getInstance();
    void setUploadLayout(QWidget* p);
    QLayout* getUploadLayout();

private:
    UploadLayout() = default;
    ~UploadLayout() = default;
    UploadLayout(const UploadLayout& obj) = delete;
    UploadLayout& operator=(const UploadLayout& obj) = delete;
    UploadLayout(UploadLayout&& obj) = delete;
    UploadLayout& operator=(UploadLayout&& obj) = delete;

    static UploadLayout* instance;
    QLayout* m_layout;
    QWidget* m_wg;
private:
    class AutoRelease
    {
    public:
        AutoRelease() = default;
        ~AutoRelease()
        {
            if(instance == nullptr) return;
            delete instance;
            instance = nullptr;
        }
    };
private:
    static AutoRelease _at;
};

#endif // UPLOADLAYOUT_H
